﻿using JESAI.Redis.Abstracts.Commands;
using System;
using System.Collections.Generic;
using System.Text;

namespace JESAI.Redis.Events
{
    public class CommandExecuteEventArgs : EventArgs
    {
        internal CommandExecuteEventArgs(IRedisCommandArg commandArg)
        {
            CommandArg = commandArg;
        }

        /// <summary>
        /// 
        /// </summary>
        public IRedisCommandArg CommandArg { get; set; }

        /// <summary>
        /// 是否缓存
        /// </summary>
        public bool IsCache { get; private set; }

        /// <summary>
        /// 返回值
        /// </summary>
        public object Value { get; private set; }

        /// <summary>
        /// 设置返回值
        /// </summary>
        /// <param name="value"></param>
        public void SetRetValue(object value)
        {
            this.Value = value;
            this.IsCache = true;
        }
    }
}
